<template>
  <div class="hello">
    <OrderList :OrderArray="array"></OrderList>
  </div>
</template>
<script>
  export default {
    name: 'HelloWorld',
    components: {},
    data () {
      return {
        array:[]
      }
    },
    methods:{
      arr() {
        var random = this.$Mock.Random;
        // console.log(random.id(1,5))
        for(var i=0;i<10;i++){
          var template = {
            number:random.natural(100000, 999999999999),
            name:random.csentence(30,50),
            price:random.natural(5, 30),
            text: random.csentence(5, 30), //  Random.csentence( min, max )
            image: random.dataImage('300x300', 'mock的图片'), // Random.dataImage( size, text ) 生成一段随机的 Base64 图片编码
            date: random.date() + ' ' + random.time() // Random.date()指示生成的日期字符串的格式,默认为yyyy-MM-dd；Random.time() 返回一个随机的时间字符串
          };
          this.array.push(template)
        }
      }
    },
    watch:{

    },
    mounted(){
      this.arr()
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .hello{
    width: 100%;
    height: 100%;
  }
  h1, h2 {
    font-weight: normal;
  }
  ul {
    list-style-type: none;
    padding: 0;
  }
  li {
    display: inline-block;
    margin: 0 10px;
  }
  a {
    color: #42b983;
  }
</style>
